import subprocess

import pytest

if __name__ == '__main__':
    pytest.main(['-s', '-q', '--alluredir', 'report/xml', 'crm/test_crm.py'])

    cmd = 'allure generate reposrts/xml -o reports/html --clean'
    subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
    cmd='allure serve report/xml'
    subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()